import request from '@/utils/request'
import {
	data
} from 'uview-ui/libs/mixin/mixin'
// 首页 首发数据
export function getCollectionList(data) {
	return request({
		url: '/appCollection/auth/getCollectionList',
		method: 'post',
		data: data,
		header: {
			'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
		}
	})
}
// 首发 藏品详情
export function getCollectionDetail(data) {
	return request({
		url: '/appCollection/auth/getCollectionDetail?id=' + data.id,
		method: 'get',
	})
}


// 抢购成功
export function collectionOrder(data) {
	return request({
		url: '/collectionOrderApp/open/add',
		data: data,
		method: 'post',
	})
}

// 抢购到的藏品详情
export function getPetDetail(data) {
	return request({
		url: '/collectionOrderApp/getPetDetail/auth/' + data.petId,
		data: data,
		method: 'get',
	})
}
// 取消抢购订单
export function initSaleCancel(data) {
	return request({
		url: '/collectionOrderApp/initSaleCancel/' + data.CollectionId + '/' + data.petId,
		data: data,
		method: 'post',
	})
}
// 确认订单
export function orderPayment(data) {
	return request({
		url: '/collectionOrderApp/payment',
		data: data,
		method: 'post',
		header: {
			'Content-Type': 'application/x-www-form-urlencoded;charset=UTF-8'
		}
	})
}
// 获取订单详情
export function getOrderDetail(data) {
	return request({
		url: '/collectionOrderApp/getOrderDetail?id=' + data.id,
		data: data,
		method: 'get',
	})
}

// 取消订单
export function getOrderCancel(data) {
	return request({
		url: '/collectionOrderApp/cancel/' + data.id,
		data: data,
		method: 'get',
	})
}